﻿using Mengsk.ProxyDelivery.Domain;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mengsk.ProxyDelivery.Print.Domain
{
    class PrintTemplateCompanyHelper
    {

        readonly static string[] KEY_WORDS = new string[] { "韵达", "圆通", "EMS", "宅急送", "顺丰", "百世", "邮政", "天天", "中通", "申通" };

        public static PrintTemplateCompany[] GetPrintSupport()
        {
            List<PrintTemplateCompany> companies = new List<PrintTemplateCompany>();

            companies.Add(new PrintTemplateCompany { DeliveryCompany = "韵达快递", Title = "韵达快递" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "圆通速递", Title = "圆通速递" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "EMS经济快递", Title = "EMS经济快递" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "宅急送", Title = "宅急送" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "顺丰速运", Title = "顺丰速运" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "百世汇通", Title = "百世汇通" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "邮政小包", Title = "邮政电商小包" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "天天快递", Title = "天天快递" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "中通速递", Title = "中通速递" });
            companies.Add(new PrintTemplateCompany { DeliveryCompany = "申通快递", Title = "申通快递" });

            return companies.ToArray();
        }

        public static string GetDeliveryCompanyKeyword(string deliveryCompany)
        {
            foreach (var s in KEY_WORDS)
            {
                if (deliveryCompany.Contains(s))
                {
                    return s;
                }
            }
            return deliveryCompany;
        }
    }
}
